import 'dart:convert';

KnowledgeFolderTreeResult knowledgeFolderTreeResultFromJson(String str) =>
    KnowledgeFolderTreeResult.fromJson(json.decode(str));

String knowledgeFolderTreeResultToJson(KnowledgeFolderTreeResult data) =>
    json.encode(data.toJson());

class KnowledgeFolderTreeResult {
  KnowledgeFolderTreeResult({
    this.status,
    this.message,
    this.result,
  });

  int? status;
  String? message;
  WordFolder? result;

  factory KnowledgeFolderTreeResult.fromJson(Map<String, dynamic> json) =>
      KnowledgeFolderTreeResult(
        status: json["status"],
        message: json["message"],
        result: WordFolder.fromJson(json["result"]),
      );

  Map<String, dynamic> toJson() => {
        "status": status,
        "message": message,
        "result": result?.toJson(),
      };
}

class WordFolder {
  WordFolder({
    this.folders,
    this.name,
    this.id,
    this.teacherId,
    this.shareStudents,
  });

  List<WordFolder>? folders;
  String? name;
  String? id;
  String? teacherId;
  List<String>? shareStudents;

  factory WordFolder.fromJson(Map<String, dynamic> json) => WordFolder(
        folders: List<WordFolder>.from(
            json["folders"].map((x) => WordFolder.fromJson(x))),
        name: json["name"],
        id: json["id"],
        teacherId: json["teacherId"],
        shareStudents: json["shareStudents"] == null
            ? null
            : List<String>.from(json["shareStudents"].map((x) => x)),
      );

  Map<String, dynamic> toJson() => {
        "folders": List<dynamic>.from(folders!.map((x) => x.toJson())),
        "name": name,
        "id": id,
        "teacherId": teacherId,
        "shareStudents": shareStudents == null
            ? null
            : List<dynamic>.from(shareStudents!.map((x) => x)),
      };
}
